/**
 * Copyright 2009 Adam Ruggles.
 * 
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 * http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.google.code.sapien.service;

import com.google.code.sapien.model.Category;
import com.google.code.sapien.security.CategoryPermissions;
import com.google.inject.ImplementedBy;

/**
 * Provides an interface for security operations for checking access.
 * @author Adam
 * @version $Id$
 * 
 * Created on May 24, 2009 at 8:44:37 PM 
 */
@ImplementedBy(SapienSecurityService.class)
public interface SecurityService {

	/**
	 * Checks the security details against the category and the array of category permissions.
	 * @param category The category to check.
	 * @param permissions An array of category permissions to check for.
	 * @return True if the security details contains all the permissions for the category, otherwise false.
	 */
	boolean checkCategoryPermissions(Category category, int[] permissions);

	/**
	 * Checks the security details against the category and the category permissions.
	 * @param category The category to check.
	 * @param permissions Category permissions.
	 * @return True if the security details contains all the permissions for the category, otherwise false.
	 */
	boolean checkCategoryPermissions(Category category, CategoryPermissions permissions);

	/**
	 * Checks the security details against the current user and returns true if the user is part of an
	 * administrator role.
	 * @return True if the user is in an administrator role.
	 */
	boolean isAdministrator();
}
